//
//  OMCouponCell.m
//  OMENGO
//
//  Created by 李峰 on 2016/12/22.
//  Copyright © 2016年 Kamfat. All rights reserved.
//

#import "OMCouponCell.h"

@implementation OMCouponCell

- (void)configure
{
    [super configure];
    [self setupView];
    
}

- (void) setupView
{
    _couponPrice = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0.35*SM_SCREEN_WIDTH, [self.class cellHeight])];
    [self addSubview:_couponPrice];
    _couponPrice.backgroundColor = SM_orangeColor;
    _couponPrice.font = SM_CBFont(100);
    _couponPrice.text = @"¥50";
    _couponPrice.textColor = SM_whiteColor;
    _couponPrice.textAlignment = NSTextAlignmentCenter;
    
    _couponName = [[UILabel alloc] initWithFrame:CGRectMake(0.40*SM_SCREEN_WIDTH,SM_SIZE(64), SM_SCREEN_WIDTH-0.35*SM_SCREEN_WIDTH-SM_SIZE(20), [self.class cellHeight]*0.25)];
    [self addSubview:_couponName];
    _couponName.font = SM_CFont(50);
    _couponName.textColor = SM_grayColor;
    _couponName.textAlignment = NSTextAlignmentLeft;
//    _couponName.text = @"50元代金券";
    _couponName.backgroundColor = SM_lightBlueColor;
    
    _couponEffectiveDate = [[UILabel alloc] initWithFrame:CGRectMake(0.4*SM_SCREEN_WIDTH, SM_SIZE(128), SM_SCREEN_WIDTH-0.35*SM_SCREEN_WIDTH-SM_SIZE(20), [self.class cellHeight]*0.30)];
    [self addSubview:_couponEffectiveDate];
    _couponEffectiveDate.textColor = SM_grayColor;
//    _couponEffectiveDate.text = @"有效期：2016.12.01～2017.01.31";
    _couponEffectiveDate.font = SM_CFont(30);
    _couponEffectiveDate.numberOfLines = 0;
    _couponEffectiveDate.backgroundColor = SM_LemonColor;
    
}

+ (CGFloat) cellHeight
{
    return SM_SIZE(200);
}
@end
